/* 
REPLICATION DATA FOR
THE PURSUIT OF SOCIAL WELFARE: CITZEN CLAIM-MAKING IN RURAL INDIA

World Politics 70, no. 1 (January 2018)

Gabrielle Kruks-Wisner
*/	

/*******************************************************************************
DATA: all_data_master_spring2017.dta
********************************************************************************

********************************************************************************
* DESCRIPTIVE STATS, SURVEY SAMPLE
********************************************************************************

* Appendix, TABLE A.1.
***********************/
	* Individual and HH characteristics, SUMMARY STATS
	sum age gender caste_st caste_sc caste_obc caste_gc land landQ1 landQ2 landQ3 landQ4 landQ5 wealth_idx edu tvrad_freq paper_freq v_official hh_cong hh_bjp active

* Appendix, TABLE A.2. 
**********************
	* Village and GP characteristics, SUMMARY STATS
	sum t_p density dist_town avg_land avg_assets avg_lit pct_sc pct_st jatifrac gphq cong_vill bjp_vill v_avg_partyfreq GP_pop sp_st sp_sc spwoman 


********************************************************************************
* DESCRIPTIVE STATS, CLAIM-MAKING (DVs)
********************************************************************************

* TABLE 1. Claim-making practice in Rajasthan
*********************************************
	sum CM_direct contact_gp contact_bur contact_party CM_mediated contact_fixer contact_nha contact_va contact_caste contact_intcaste contact_ngo contact_pm CM_incidence CM_index

* FIGURE 1. Distribution of the claim-making repertoire (full sample)
*********************************************************************
	hist CM_index, percent

* FIGURE 2. Claim-making incidence disagregated
***********************************************
	graph bar (mean) CM_incidence, over (land_quint) yline (.756)
	graph bar (mean) CM_incidence, over (caste_cat) yline (.756)
	graph bar (mean) CM_incidence, over (gender) yline (.756)

	gen castegender = 1 if scwoman == 1
	replace castegender = 2 if stwoman == 1
	replace castegender = 3 if obcwoman == 1
	replace castegender = 4 if gcwoman == 1

	graph bar (mean) CM_incidence, over (castegender) yline (.756)

* FIGURE 3. Claim-making repertoire
************************************
	graph bar (mean) CM_index, over (land_quint) yline (1.999)
	graph bar (mean) CM_index, over (caste_cat) yline (1.999)
	graph bar (mean) CM_index, over (gender) yline (1.999)
	graph bar (mean) CM_index, over (castegender) yline (1.999)
	

* TABLE A.3. COLLECTIVE AND SELECTIVE SERVICES (Claim-making practice)
**********************************************************************
	sum CM_direct_vs contact_gp_vs contact_bur_vs contact_party_vs CM_mediated_vs contact_fixer_vs contact_nha_vs contact_va_vs contact_caste_vs contact_intcaste_vs contact_ngo_vs contact_pm_vs CM_incidence_vs CM_index_vs
	sum CM_direct_scm contact_gp_scm contact_bur_scm contact_party_scm CM_mediated_scm contact_fixer_scm contact_nha_scm contact_va_scm contact_caste_scm contact_intcaste_scm contact_ngo_scm contact_pm_scm CM_incidence_scm CM_index_scm

* TABLE A.4. EFFICACY OF CLAIM-MAKING PRACTICES
***********************************************
	* 	Perceived effectiveness of given channel
	*	0 = not, 1 = somewhat/very (2 or 3 in coding)
	*	Note: missing data for fixers

	local practices "gp bd party na vda ca vc ngo pm"
	foreach prac of local practices {
		gen effective_`prac' = 0
		replace effective_`prac' = 1 if `prac'_effec == 2 | `prac'_effec == 3
		}

* 	Perceived effectiveness across whole sample (whether or not channel is present or used)
	sum effective_gp effective_bd effective_party effective_na effective_vda effective_ca effective_vc effective_ngo effective_pm

* 	Effectiveness of practice conditional on presence of channel in village
	sum effective_na if na == 1
	sum effective_vda if vda == 1
	sum effective_ca if ca == 1
	sum effective_vc if vc == 1
	sum effective_ngo if ngo == 1
	sum effective_pm if pm == 1

* 	Effectiveness of practice conditional on making a claim through that channel
	sum effective_gp if contact_gp == 1
	sum effective_bd if contact_bur == 1
	sum effective_party if contact_party == 1
	sum effective_na if contact_nha == 1
	sum effective_vda if contact_va == 1
	sum effective_ca if contact_caste == 1
	sum effective_vc if contact_intcaste == 1
	sum effective_ngo if contact_ngo == 1
	sum effective_pm if contact_pm == 1

* TABLE A.5. MEDIATED CLAIM-MAKING BY PRESENCE OF CHANNEL 
*********************************************************
	* 	column 1, contact (full sample mean)
	sum contact_fixer contact_nha contact_va contact_caste contact_intcaste contact_ngo contact_pm

	* 	column 2, reported present (full sample mean)
	sum fixers na vda ca vc ngo pm fixers

	* 	column 3, reported present by > 50% in village
	sum fixers50pct na50pct vda50pct ca50pct vc50pct ngo50pct pm50pct

	* 	colum 4, contact (conditional on presence:contact_x if x50pct == 1)
	sum contact_fixer if fixers50pct == 1
	sum contact_nha if na50pct == 1
	sum contact_va if vda50pct == 1
	sum contact_caste if ca50pct == 1
	sum contact_intcaste if vc50pct == 1
	sum contact_ngo if ngo50pct == 1
	sum contact_pm if pm50pct == 1

* TABLE A.6. COMBINATIONS OF DIRECT AND MEDIATED PRACTICE
*********************************************************
	sum CM_dirmed CM_dironly CM_medonly
	sum gp_only gp_bur_combo gp_party_combo gp_mediated gp_fixer_combo gp_nha_combo gp_va_combo gp_caste_combo gp_intcaste_combo gp_ngo_combo gp_pm_combo
	sum party_only party_gp_combo party_bur_combo party_mediated party_fixer_combo party_nha_combo party_va_combo party_caste_combo party_intcaste_combo party_ngo_combo party_pm_combo

* TABLE A.7. DIFFERENCES IN MEANS: CLAIM-MAKING BY SES, CASTE, GENDER 
*********************************************************************

	* diff in means by land quntiles (each quint compared to everyone else)
	sort land_quint

	* diff in means by land quintile, comparing Q1 and Q5 (where 0 = most and 1 = least)
	gen landtest = land_quint
	recode landtest (5=0) (1=1) (2=.) (3=.) (4=.)

	foreach quintile in landQ1 landQ2 landQ3 landQ4 landQ5 landtest {
		ttest CM_index, by(`quintile')
		}
	
	foreach practice in gp bur party fixer nha va caste intcaste ngo pm {
		prtest contact_`practice', by(landQ1)
		}

	foreach practice in gp bur party fixer nha va caste intcaste ngo pm {
		prtest contact_`practice', by(landQ2)
		}

	foreach practice in gp bur party fixer nha va caste intcaste ngo pm {
		prtest contact_`practice', by(landQ3)
		}

	foreach practice in gp bur party fixer nha va caste intcaste ngo pm {
		prtest contact_`practice', by(landQ4)
		}

	foreach practice in gp bur party fixer nha va caste intcaste ngo pm {
		prtest contact_`practice', by(landQ5)
		}

	foreach practice in gp bur party fixer nha va caste intcaste ngo pm {
		prtest contact_`practice', by(landtest)
	}

* diff in means by caste category (each caste cat compared to everyone else)
	sort caste_cat

	* diff in means by caste, comparing ST (2) to GC (4) and SC (1) to GC (4)
	gen ST_GCtest = caste_cat
	recode ST_GCtest (4=0) (1=.) (2=1) (3=.)

	gen SC_GCtest = caste_cat
	recode SC_GCtest (4=0) (1=1) (2=.) (3=.)

	foreach caste in caste_st caste_sc caste_obc caste_gc ST_GCtest SC_GCtest {
		ttest CM_index, by(`caste')
		}
	
	foreach practice in gp bur party fixer nha va caste intcaste ngo pm {
		prtest contact_`practice', by(caste_st)
		}

	foreach practice in gp bur party fixer nha va caste intcaste ngo pm {
		prtest contact_`practice', by(caste_sc)
		}

	foreach practice in gp bur party fixer nha va caste intcaste ngo pm {
		prtest contact_`practice', by(caste_obc)
		}

	foreach practice in gp bur party fixer nha va caste intcaste ngo pm {
		prtest contact_`practice', by(caste_gc)
		}

	foreach practice in gp bur party fixer nha va caste intcaste ngo pm {
		prtest contact_`practice', by(ST_GCtest)
		}

	foreach practice in gp bur party fixer nha va caste intcaste ngo pm {
		prtest contact_`practice', by(SC_GCtest)
		}

* diff in means by GENDER (0 = men, 1 = women)
	sort gender
	ttest CM_index, by(gender)

	prtest CM_incidence, by(gender)

	foreach practice in gp bur party fixer nha va caste intcaste ngo pm {
		prtest contact_`practice', by(gender)
		}

* diff in means by CASTE*GENDER (comparing SC and ST women to all other women - not in table, but reported in text?)
		prtest CM_incidence if gender == 1, by(stwoman)
	prtest CM_incidence if gender == 1, by(scwoman)
	prtest CM_incidence if gender == 1, by(obcwoman)
	prtest CM_incidence if gender == 1, by(gcwoman)

	ttest CM_index if gender == 1, by(stwoman)
	ttest CM_index if gender == 1, by(scwoman)
	ttest CM_index if gender == 1, by(obcwoman)
	ttest CM_index if gender == 1, by(gcwoman)



********************************************************************************
* DESCRIPTIVE STATS, EXPOSURE (IVs)
********************************************************************************

* TABLE 2. INDICATORS OF SOCIAL AND SPATIAL EXPSOSURE
*****************************************************
sum  XCW MIG XCCG XNH_bin SSE_index



********************************************************************************
* DEFINING DEPENDENT VARIABLES (CLAIM-MAKING)
********************************************************************************
	* incidence: CM_incidence (probit)
	* repertoire: CM_index (OLS)
	* practices (probit)
	local practice "contact_gp contact_bur contact_party contact_assoc contact_caste contact_intcaste contact_ngo contact_pm contact_fixer"
	* combined practices (probit)
	local combos "CM_direct CM_dironly CM_mediated CM_medonly CM_dirmed prac_single prac_multiple prac_couple prac_most"


********************************************************************************
* DEFINING INDEPENDENT VARIABLES (EXPOSURE)
********************************************************************************
	* individual measures: XNH_bin, XCCG, XCW, MIG
	* index of individual exposure: SSE_index
	* vill measure: landlabor2 
|
	
********************************************************************************
* DEFINING CONTROLS (INDIVIDUAL AND HH LEVEL) 
	* NOTE: for final, public replication code, delete the unused locals
********************************************************************************

	* Identity (CORE MODEL)
	local identity "age age2 gender caste_st caste_sc caste_obc"
		*	NOTE: caste dummies compared to caste_gc
	
		* Identity dropping caste
		local identity2 "age age2 gender"
			* NOTE: for effects of st, sc, obc, gc compared to all others, drop caste dummies and use single caste var (each in own regression)
				* `identity2' caste_st, etc....

	* Caste and gender interaction effects (CORE MODEL)
	local castegender "scwoman stwoman obcwoman"
		*	NOTE: caste*gender dummies compared to GC women
		
	* Wealth, using land quintiles & index (CORE MODEL)
		local economic2 "landQ1 landQ2 landQ3 landQ4 wealth_idx wealth_idx2"
			* NOTE: landQ1-4 compared to Q5
			
		* Wealth (basic measures)
		local economic1 "land land2 wealth_idx wealth_idx2"
			
		* Wealth (using landless)
			local economic3 "landless wealth_idx wealt	h_idx2"
		
		* Wealth (using pucca house)
			local economic4 "landQ1 landQ2 landQ3 landQ4 puccahouse"
		
		* Wealth (using kaccha house)
			local economic5 "landQ1 landQ2 landQ3 landQ4 kacchahouse"
		
		* Welath (using caste*land interactions (compared to GC))
			local economic6 "landQ1 landQ2 landQ3 landQ4 wealth_idx wealth_idx2 sc_leastland st_leastland obc_leastland sc_mostland st_mostland obc_mostland"
	
	* Occupation (CORE MODEL)
	local occupation1 "ag_own ag_labor nf_labor nf_ent"
	
		local occupation2 "NonAg"
		local occupation3 "nrega_work salaried"
			* USED FOR XCW AND LANDLABOR 

	* Level of education (CORE MODEL)
	local education1 "ed_prim ed_sec ed_higher"
		* NOTE: compared to ed_none
		
	* Media exposure (CORE MODEL)
	local media "tvrad_freq paper_freq"
		
		* drop paper, use just tvrad_freq to check for colinearity between paper (proxy for literacy) and education
			* USED WHEN REPORTING EFFECTS OF EDUCATION IN TEXT 

		* Knowledge of government schemes (NOT USED IN CORE MODEL)	
		local govknow " gs_know rti_know nrega_know"
		recode nrega_know (1=0) (2=1)
			* NOTE: not including in core model bc colinear with SSE; use as separate test of relationship between SSE and knowledge/info

	* Political connections (CORE MODEL)
	local political1 "v_official hh_cong hh_bjp"
		
		* Any partisanship, Congress OR BJP
		local political2 "v_official hh_partisan"
			* used for test of effect of any partisanship
		
		* Non-partisans
		local political3 "v_official hh_noparty"
		

	* Individual effect of GP reservations -- identity match (CORE MDOEL)
	local GP_match "SPmatch_sc SPmatch_st SPmatch_obc SPmatch_wom"
		* NOTE: GP_match uses election commission data; alternatives based on survey responses are HHSP_match & HHSP_match2 (see controls do file)
			* not including SPmatch_gc (since GC is caste control group)

		* current reservations AND last 5-year term
		local GP_match2 "SPmatch_sc SPmatch_sc5 SPmatch_st SPmatch_st5 SPmatch_obc SPmatch_obc5 SPmatch_wom SPmatch_wom5"
			* not including SPmatch_gc (since GC is caste control group)

	* Active/social personality: "active" (frequent social contact within own NH) == "social" (CORE MODEL)

	* Level of need for services/access to serviecs: hh_ALLPGS (CORE MODEL)
		* NOTE: FOR BOOK ANALYSIS, DROP THIS

	* Use of private services (exit options; CORE MODEL)
	local private_service "privschool privhealth privwater"
		* privservice = use of any of above
		* 	NOTE: FOR BOOK ANALYSIS, DROP THIS (OVER CONTROLLING)

		
* list of all individual controls (CORE MODEL)
**********************************************
local indcontrol " `identity' `castegender' `economic2' `occupation1' `education1' `media' `political1' `GP_match' hh_ALLPGS privservice active"

* 	Alternative specifications of individual controls
	**************************************************
	* individual controls, without caste (dropping caste dummies and castegender)
	local indcontrol2 " `identity2' `economic2' `occupation1' `education1' `media' `political1' `GP_match' privservice active"

	* individual controls using occupation2 (NonAg)
	local indcontrol3 " `identity' `castegender' `economic2' `occupation2' `education1' `media' `political1' `GP_match' privservice active"

	* individual controls without occupation
	local indcontrol4 " `identity' `castegender' `economic2' `education1' `media' `political1' `GP_match' privservice active"

	* individual controls without caste and occupation
	local indcontrol5 " `identity2' `economic2' `education1' `media' `political1' `GP_match' privservice active"

	* individual controls using occupation 3 (nrega_work and salaried)
	local indcontrol6 " `identity' `castegender' `economic2' `occupation3' `education1' `media' `political1' `GP_match' privservice active"

	* individual controls dropping partisan ties (v_official only)
	local indcontrol7 " `identity' `castegender' `economic2' `occupation1' `education1' `media' `political3' `GP_match' privservice active"

	* individual controls dropping newspaper readership
	local indcontrol8 " `identity' `castegender' `economic2' `occupation1' `education1' tvrad_freq `political1' `GP_match' privservice active"

	* individual controls with HH partisanship, dropping BJP and Congress
	local indcontrol9 " `identity' `castegender' `economic2' `occupation1' `education1' `media' `political2' `GP_match' privservice active"

	* individual controls with HH partisanship (political2) AND Nregs (occupation3)
	local indcontrol10 " `identity' `castegender' `economic2' `occupation3' `education1' `media' `political2' `GP_match' privservice active"

	
* Household controls (CORE MODEL)
**********************************
local hhcontrol "hh_size hh_child hh_eld"


********************************************************************************
* DEFINING CONTROLS (VILLAGE AND GP LEVEL) 
	* NOTE: for final, public replication code, delete the unused locals
********************************************************************************

* Village demography (CORE MODEL)
local v_demog "t_p density nh_hamlet jatifrac"

	* Alternative measures of jatifrac
	local v_demog2 "t_p density nh_hamlet jati_num"
	local v_demog3 "t_p density nh_hamlet nh_mixed"

	* vill demography with jatifrac without nh_hamlet
	local v_demog4 "t_p density jatifrac"
	
	* vill demography with % SC and % ST (dropping jatifrac)
	local v_demog5 "t_p density pct_sc pct_st"

* Village development (CORE MODEL)
local v_dev "avg_lit avg_land avg_assets"

* Village political geography (CORE MODEL)
local v_political1 "dist_town gphq spvil cong_vill bjp_vill v_avg_partyfreq"

	* Dropping partisanship and party visits
	local v_political2 "dist_town gphq spvil"
	
	* Adding dominant party
	local v_political3 "dist_town gphq spvil party_dom"

	* Adding Congress or BJP majorities
	local v_political4 "gphq spvil cong_vill bjp_vill"
		* NOTE: dropping dist_town
	
	* Adding villages that are 10 K or less from closest town
	gen closetown = 0
	replace closetown = 1 if dist_town <= 10
	local v_political5 "closetown spvil gphq cong_vill bjp_vill"

* Village institutional environment
* vill_env = number of local institutions (CORE MODEL)

	* Presence of local institutions 
	local villinst "ngo50pct vda50pct na50pct ca50pct vc50pct"

	
* list of all village control (CORE MODEL - using vilcontrol2)
**************************************************************
* village controls using vill_env instead of `villinst' (core model)
local vilcontrol2 " `v_demog' `v_dev' `v_political1' vill_env "

	* Alternative specifications of village controls
	************************************************
	
	* Using villinst (instead of vill_env)
	local vilcontrol " `v_demog' `v_dev' `v_political1' `villinst' "

	* village controls using jati_num (not jatifrac)
	local vilcontrol3 " `v_demog2' `v_dev' `v_political1' vill_env "

	* village controls using nh_mixed (not jatifrac)
	local vilcontrol4 " `v_demog3' `v_dev' `v_political1' vill_env "

	* village controls with jatifrac but dropping nh_hamlet (for use with SSmix2/mainvill)
	local vilcontrol5 " `v_demog4' `v_dev' `v_political1' vill_env "

	* village controls without dist_town (with jatifrac)
	local vilcontrol6 "`v_demog' `v_dev' `v_political4' vill_env "	
	
	* village controls using "closetown" (v_political5)
	local vilcontrol7 " `v_demog' `v_dev' `v_political5' vill_env "
	
	* village controls using v_political2 (dropping parties)
	local vilcontrol8 " `v_demog' `v_dev' `v_political2' vill_env "
	
	* village controls using v_demog5 (% sc, % st)
	local vilcontrol9 " `v_demog5' `v_dev' `v_political1' vill_env "

	
* GP controls (CORE MODEL)
**************************
local gpcontrol "GP_vil GP_pop sp_st sp_sc sp_obc spwoman"
	* reservations compared to sp_gc and sp man

	local gpcontrol2 "GP_vil sp_st sp_sc sp_obc spwoman"
	* dropping GP_pop bc of colinearity with gphq

	* using both current and past 5-year reservations
	local gpcontrol3 "GP_vil GP_pop sp_st sp_sc sp_obc spwoman sp5_st sp5_sc sp5_obc sp5woman"


********************************************************************************
* FIXED EFFECTS AND CLUSTERING
********************************************************************************

* District dummies (CORE MODEL)
local district "udaipur kota jodhpur"
	*	NOTE: all districts compared to ajmer

* Block fixed effects
local block "bargaon gogunda itawa sangod mandor shergarh peesangan"
	*	districts compared to masuda (ajmer)

	* GP fixed effects:"absorb(uniq_gp_id)" or "absorb(uniq_gp_id)" (ols)

	* Village fixed effects: "i.uniq_vill_id" or "absorb(uniq_vill_id)" (ols)
		* use areg for these regressions
		
* Standard errors clustered at village level (cluster(uniq_vill_id)) (CORE MODEL)



********************************************************************************
* MULTIVARIATE REGRESSION  (CORRELATES OF  CLAIM-MAKING)
********************************************************************************
* Outcomes are claim-making (incidence, repertoire, and practices)
* Independnet variables are indicators of exposure, each assessed in separate model, and index of exposure
* Correaltes of claim-making (for Tables 5, A.8, A.9) estimated in models where SSE_index is a control

* Unless otherwise stated using: CORE MODEL
	* indcontrol (" `identity' `castegender' `economic2' `occupation1' `education1' `media' `political1' `GP_match' privservice active")
	* hhcontrol
	* vilcontrol2 (" `v_demog' `v_dev' `v_political1' vill_env ")
	* gpcontrol
	* district fixed effects
	
* Exceptions, XCW and landlabor2 using indcontrol6
	
* Results for tables in text 
		* TABLE 3. EXPOSURE AND CLAIM-MAKING (MAIN EFFECTS)			
		* TABLE 4. LAND-LABOR RATIO & CLAIM-MAKING
		* TABLE 5. CORRELATES OF CLAIM-MAKING (SELECTED)
	
* 	Results for tables in Appendix
		* TABLE A.8. VILLAGE & GP CORREALTES OF CLAIM-MAKING
		* TABLE A.9. INDIVIDUAL CORRELATES OF CLAIM-MAKING
		* A.10 EXPOSURE AND CLAIM-MAKING, FULL RESULTS
	
	
******************************************
* INDEX OF EXPOSURE (SSE_index, binary)
	* Results for Tables 3, A.8, A.9, A.10
******************************************
*SSE_index_indidence (using probit)
* clears stored estimates
eststo clear

	xi: probit CM_incidence SSE_index `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
	xi: dprobit CM_incidence SSE_index `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	eststo

* SSE_index_repertoire (using OLS)
	regress CM_index SSE_index `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
    eststo
	
* SSE_index_practices (using probit)
foreach cmstrat of local practice {
	xi: probit `cmstrat' SSE_index `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
	xi: dprobit `cmstrat' SSE_index`indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
    eststo
	}

* outputs stored estimates in table
esttab using "tablea8a9.csv", label nocons se replace drop(_cons udaipur kota jodhpur age age2) pr2 r2 margin b(%12.2g) se(%12.2g) star(* 0.10 ** 0.05 *** 0.01)
esttab using "tablea10SSE.csv", label nocons se replace keep(SSE_index) pr2 r2 margin b(%12.2g) se(%12.2g) star(* 0.10 ** 0.05 *** 0.01)



**************************************************
* CROSS-NEIGHBORHOOD TIES (XNH_bin, binary)
	* Results for Tables 3, A.10
**************************************************
* XNH_bin_incidence (using probit)
eststo clear

	xi: probit CM_incidence XNH_bin `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
	xi: dprobit CM_incidence XNH_bin `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
    eststo
    	
* XNH_bin_repertoire (using OLS)
	regress CM_index XNH_bin `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
    eststo

* XNH_bin_practices (using probit)
foreach cmstrat of local practice {
	xi: probit `cmstrat' XNH_bin `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
	xi: dprobit `cmstrat' XNH_bin `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
    eststo
	}

esttab using "tablea10XNH.csv", label nocons se replace keep(XNH_bin) pr2 r2 margin b(%12.2g) se(%12.2g) star(* 0.10 ** 0.05 *** 0.01)


**************************************************
* MIXED-CASTE CULTURAL GROUP (XCCG, binary)
	* Results for Tables 3, A.10
**************************************************
* XCCG_incidence (using probit)
eststo clear

	xi: probit CM_incidence XCCG `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
	xi: dprobit CM_incidence XCCG `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
    eststo
    	
* XCCG_repertoire (using OLS)
	regress CM_index XCCG `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
    eststo

* XCCG_practices (using probit)
foreach cmstrat of local practice {
	xi: probit `cmstrat' XCCG `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
	xi: dprobit `cmstrat' XCCG `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	eststo
    }

esttab using "tablea10XCCG.csv", label nocons se replace keep(XCCG) pr2 r2 margin b(%12.2g) se(%12.2g) star(* 0.10 ** 0.05 *** 0.01)

	
********************************************************************************
* MIXED-WORKPLACE (XCW, binary)
	* Results for Tables 3, A.10
	* using indcontrol6
		* includes occupation3 (nrega_work salaried; dropping other occ controls)
		* controls for public sector employment  
********************************************************************************
* XCW_incidence (using probit)
eststo clear

	xi: probit CM_incidence XCW `indcontrol6' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
	xi: dprobit CM_incidence XCW `indcontrol6' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	eststo

* XCW_repertoire (using OLS)
	regress CM_index XCW `indcontrol6' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
    eststo

* XCW_practices (using probit)
foreach cmstrat of local practice {
	xi: probit `cmstrat' XCW `indcontrol6' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
	xi: dprobit `cmstrat' XCW `indcontrol6' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	eststo
    }

esttab using "tablea10XCW.csv", label nocons se replace keep(XCW) pr2 r2 margin b(%12.2g) se(%12.2g) star(* 0.10 ** 0.05 *** 0.01)


*****************************************
* MIG: Migration (household, MIG, binary)
	* Results for Tables 3, A.10
*****************************************
* MIG_incidence (using probit)
eststo clear

	xi: probit CM_incidence MIG `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
	xi: dprobit CM_incidence MIG `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
    eststo
    	
* MIG_repertoire (using OLS)
	regress CM_index MIG `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
    eststo

* MIG_practices (using probit)
foreach cmstrat of local practice {
	xi: probit `cmstrat' MIG `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
	xi: dprobit `cmstrat' MIG `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	eststo
    }

esttab using "tablea10MIG.csv", label nocons se replace keep(MIG) pr2 r2 margin b(%12.2g) se(%12.2g) star(* 0.10 ** 0.05 *** 0.01)

	
********************************************************************************
* LAND-TO-LABOR RATIO (village, landlabor2) 
* Results for Tables 3, A.10
	* using indcontrol6
		* includes occupation3 (nrega_work salaried; dropping other occ controls)
		* controls for public sector employment  
********************************************************************************
* LL_incidence (using probit)
eststo clear

	xi: probit CM_incidence landlabor2 `indcontrol6' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
	xi: dprobit CM_incidence landlabor2 `indcontrol6' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
    eststo
    	
* LL_repertoire (using OLS)
	regress CM_index landlabor2 `indcontrol6' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
    eststo

* LL_practices (using probit)
foreach cmstrat of local practice {
	xi: probit `cmstrat' landlabor2 `indcontrol6' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
	xi: dprobit `cmstrat' landlabor2 `indcontrol6' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	eststo
    }

esttab using "tablea10landlabor2.csv", label nocons se replace keep(landlabor2) pr2 r2 margin b(%12.2g) se(%12.2g) star(* 0.10 ** 0.05 *** 0.01)



		********************************************************************************
		* ALTERNATIVE ESTIMATIONS - ADDITIONAL ANALYSIS FOR CORRELATES OF CLAIM-MAKING
		********************************************************************************

		* EFFECTS OF EDUCATION, DROPPING NEWSPAPERS
		* Results in text, not in tables
		* using indcontrol8, dropping media local and using just tvrad_freq
		
			* SSE_index_incidence (using probit), dropping newspaper

			xi: probit CM_incidence SSE_index `indcontrol8' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
			xi: dprobit CM_incidence SSE_index `indcontrol8' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
			* SSE_index_repertoire (using OLS), dropping newspaper
			regress CM_index SSE_index `indcontrol8' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)

	
		* EFFECTS OF *ANY* PARTISANDIP (BJP OR CONGRESS), DROPPING  BJP and Congress HH
		* Results presented in Table 5
		* Note: Appendix (A.8, A.9 show effects of BJP or Congress HH, while Tables 5 & 6 in text show effect of ANY)
		* using poltical2 "v_official hh_partisan" in indcontrol9

			* SSE_index_incidence (using probit), hh partisanship

			xi: probit CM_incidence SSE_index `indcontrol9' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
			xi: dprobit CM_incidence SSE_index `indcontrol9' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
			* SSE_index_repertoire (using OLS),  hh partisanship
			regress CM_index SSE_index `indcontrol9' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)

	

********************************************************************************
* MULTIVARIATE REGRESSION  (CORRELATES OF  EXPOSURE)
********************************************************************************
* Outcomes are indicators of exposure (XNH_bin, XCCG, XCW, MIG, SSE_index, landlabor2)
* Independnet variables are individual, hh, village, gp controls

* Unless otherwise stated using: CORE MODEL
	* indcontrol (" `identity' `castegender' `economic2' `occupation1' `education1' `media' `political1' `GP_match' privservice active")
	* hhcontrol
	* vilcontrol2 (" `v_demog' `v_dev' `v_political1' vill_env ")
	* adding landlabor2 as control
	* gpcontrol
	* district fixed effects
	
* Exceptions, XCW and landlabor2 using indcontrol6
	
* Results for tables in text 
		* TABLE 6. CORRELATES OF EXPOSURE (SELECTED)
		* TABLE 4. Correlation of LLR and Index of expsosure
	
* 	Results for tables in Appendix
		* TABLE A.11. VILLAGE & GP CORREALTES OF EXPOSURE
		* TABLE A.12. INDIVIDUAL CORRELATES OF EXPOSURE
		* A.10 EXPOSURE AND CLAIM-MAKING, FULL RESULTS
		

********************************************************************************
* 	DEFINING DEPENDENT VARIABLES (EXPOSURE)
********************************************************************************
* binary outcomes (using probit)
local outcomes "XNH_bin XCCG MIG"
* landlabor2


********************************************************************************
*	BINARY MEASURES OF EXPOSURE (using probit & core model)
	* results for XNH_bin, XCCG, MIG 
********************************************************************************
eststo clear

foreach mobmeasure of local outcomes {
	xi: probit `mobmeasure' landlabor2 `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
	xi: dprobit `mobmeasure' landlabor2 `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	eststo
    }

********************************************************************************
* MIXED-CASTE WORKPLACE (XCW, binary)
	* using indcontrol6: 
	* includes occupation3 (nrega_work salaried, dropping other occ controls)
	* controling for possible public sector employment 
********************************************************************************
	
	xi: probit XCW landlabor2 `indcontrol6' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
	xi: dprobit XCW landlabor2 `indcontrol6' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
    eststo
	
********************************************************************************
* INDEX OF SOCIAL AND SPATIAL EXPOSURE (SSE_index) (using OLS) 
******************************************************************************** 

	regress SSE_index landlabor2 `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
    eststo

* landlabor as outcome
	* using indcontrol6: includes occupation3 (nrega_work salaried)
	* controling for possible public sector employment but not for farm/non-farm labor, which could covary with XCW
	regress landlabor2 `indcontrol6' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
    eststo

esttab using "tablea11a12.csv", label nocons se replace drop(_cons udaipur kota jodhpur age age2) pr2 r2 margin b(%12.2g) se(%12.2g) star(* 0.10 ** 0.05 *** 0.01)

	
		********************************************************************************
		* ALTERNATIVE ESTIMATIONS - ADDITIONAL ANALYSIS FOR CORRELATES OF EXPOSURE
		********************************************************************************* 

		* EFFECTS OF *ANY* PARTISANDIP (BJP OR CONGRESS), DROPPING  BJP and Congress HH
		* Results presented in Table 6
		* Note: Appendix (A.11, A.12 show effects of BJP or Congress HH, while Tables 5 & 6 in text show effect of ANY)
		* using poltical2 "v_official hh_partisan" in indcontrol9

			* BINARY MEASURES OF EXPOSURE (XNH_bin, XCCG, MIG, using probit & core model)
			foreach mobmeasure of local outcomes {

			xi: probit `mobmeasure' landlabor2 `indcontrol9' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
			xi: dprobit `mobmeasure' landlabor2 `indcontrol9' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
			}
	
			* MIXED-CASTE WORKPLACE (XCW, binary) 
			* using indcontrol10: includes political2 (as above) AND occupation3 (nrega_work salaried)
	
				xi: probit XCW landlabor2 `indcontrol10' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
				xi: dprobit XCW landlabor2 `indcontrol10' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)

			* INDEX OF SOCIAL AND SPATIAL EXPOSURE (SSE_index) (using OLS) 
			* using poltical2 "v_official hh_partisan" in indcontrol9
			regress SSE_index landlabor2 `indcontrol9' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	

		* EFFECTS OF EDUCATION, DROPPING NEWSPAPERS
		* Results in text, not in tables
		* using indcontrol8, dropping media local and using just tvrad_freq
		
			* binary measures of exposure (using probit)
			foreach mobmeasure of local outcomes {

			xi: probit `mobmeasure' landlabor2 `indcontrol8' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
			xi: dprobit `mobmeasure' landlabor2 `indcontrol8' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
			}
	
			* SSE_index (using OLS),  hh partisanship
			regress SSE_index landlabor2`indcontrol8' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)


********************************************************************************
* 	INTERACTION EFFECTS: DIFFERENTIAL EFFECTS OF EXPOSURE ON CLAIM-MAKING
	* 	wealth index, caste categories (compared to GC), gender -- all X exposure
	* 	Results reported in TABLE 7
	
	* 	Estimations using core model, same as for correaltes of CM, above
	*	indcontrol, hhcontrol, vilcontrol2, gpcontrol, district
********************************************************************************

* Creating interaction terms: wealth, caste, gender x exposure
foreach var in XNH_bin XCW MIG SSE_index {
	foreach iden in wealth_idx caste_sc caste_st caste_obc gender  {
		gen `var'_`iden' = `var' * `iden'
		}
	}

* SSE_index_incidence (using probit)

	xi: probit CM_incidence SSE_index SSE_index* `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
	xi: dprobit CM_incidence SSE_index SSE_index* `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
* SSE_index_repertoire (using OLS)
	regress CM_index SSE_index SSE_index* `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)

	
* SSE_index_practices (using probit)
foreach cmstrat of local practice {
	xi: probit `cmstrat' SSE_index SSE_index* `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
	xi: dprobit `cmstrat' SSE_index SSE_index* `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	}

* XNH_bin_incidence (using probit)

	xi: probit CM_incidence XNH_bin XNH_bin* `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
	xi: dprobit CM_incidence XNH_bin XNH_bin* `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
* XNH_bin_repertoire (using OLS)
	regress CM_index XNH_bin XNH_bin* `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)


* XCCG_incidence (using probit)

	xi: probit CM_incidence XCCG XCCG* `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
	xi: dprobit CM_incidence XCCG XCCG* `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
* XCCG_repertoire (using OLS)
	regress CM_index XCCG XCCG* `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)


* XCW_incidence (using probit)

	xi: probit CM_incidence XCW XCW* `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
	xi: dprobit CM_incidence XCW XCW* `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
* XCW_repertoire (using OLS)
	regress CM_index XCW XCW* `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)


* MIG_incidence (using probit)

	xi: probit CM_incidence MIG MIG* `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
	xi: dprobit CM_incidence MIG MIG* `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
	
* MIG_repertoire (using OLS)
	regress CM_index MIG MIG* `indcontrol' `hhcontrol' `vilcontrol2' `gpcontrol' `district', cluster(uniq_vill_id)
